﻿using System;

namespace Operations
{
    public abstract class OperationBase : IOperation
    {
        public OperationProcessor Processor { get; set; }
        
        public bool CanExecute(out string error)
        {
            CanExecute();
            return (error = Error) != null;
        }

        public virtual void CanExecute()
        {
        }



        protected string Error { get; private set; }

        protected void SetError(string error)
        {
            Error = error;
        }

        void IOperation.Execute()
        {
            throw new NotImplementedException();
        }

        bool IOperation.CanExecute(out string error)
        {
            throw new NotImplementedException();
        }
    }
}